package com.irdstudio.apicenter.console.service.authenticate;

import java.sql.SQLException;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.irdstudio.apicenter.console.dm.AppOrg;
import com.irdstudio.apicenter.console.dm.AppOrgDao;

@Service(value = "appOrgService")
public class AppOrgService {

	@Autowired
	private AppOrgDao appOrgDao;

	public int insertOne(AppOrg appOrg) throws SQLException,
			ClassNotFoundException {
		return appOrgDao.saveAppOrg(appOrg);
	}

	public AppOrg queryAppTradePrivate(String appId, String orgId)
			throws SQLException {
		return appOrgDao.queryWithKeys(appId, orgId);
	}

	public int update(AppOrg appOrg) throws SQLException,
			ClassNotFoundException {
		return appOrgDao.update(appOrg);
	}

	public int delete(AppOrg appOrg) throws SQLException,
			ClassNotFoundException {
		return appOrgDao.delete(appOrg);
	}
}
